<% unless @products.blank? %>
    <table id="admin-products-table">
        <tr>
          <th>Marca</th>
          <th>Modelo</th>
          <th>Estado</th>
        </tr>

        <% products.each do |product| %>
            <tr>
              <td><%= product.brand.name %></td>
              <td><%= link_to "#{product.model}", admin_product_path(product.id) %></td>
              <td><%= show_visible product.display %></td>
              <td><%= link_to "Agotar / Habilitar stock", admin_sold_out_product_path(product.id) %></td>
              <% if product.display? %>
                  <td><%= link_to "Ocultar", admin_toggle_product_path(product.id) %></td>
              <% else %>
                  <td><%= link_to "Mostrar", admin_toggle_product_path(product.id) %></td>
              <% end %>
              <td><%= link_to "Editar", edit_admin_product_path(product.id) %></td>
              <td><%= link_to 'Eliminar', admin_product_path(product.id), :method => :delete, :confirm => "¿Está seguro que desea eliminar el producto #{product.model}?" %></td>
            </tr>
        <% end %>
    </table>
      <p><%= will_paginate @products %></p>
<% else %>
    <span>No hay productos cargados.</span>
<% end %>